]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
grabHelper: Special case event funneling towards the OSK
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 9 Mar 2022 22:11:03 +0000 (23:11 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sat, 12 Mar 2022 09:28:14 +0000 (09:28 +0000)
In the case of bringing up the OSK while there is a grab (like, every
GNOME Shell entry), we used to special case event capturing so events
directed to the OSK would be let through.

When Clutter.Grab came around, events would be propagated only within
the actor hierarchy that holds the grab, which rendered this special
case just as useless as the OSK while a grab was hold. Since it wouldn't
be part of the grab hierarchy, clicking on the OSK would do nothing.

In order to let the OSK handle events, double down on the special case
and let it forward the event directly to the actor under the device,
instead of trying to let it through somehow. Since the actor under the
device are usually OSK buttons in this case, we don't need further
propagation to make it work, which makes the OSK functional again while
the shell holds a grab.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2237>

js/ui/grabHelper.js
js/ui/keyboard.js

index af4641014a61da4c4a64920a5a27a0f3d4460342..c4028fc38bcf47937641765ab074ce4e658686ce 100644 (file)
@@ -272,7 +272,7 @@ var GrabHelper = class GrabHelper {
             this.currentGrab.actor.contains(targetActor))
             return Clutter.EVENT_PROPAGATE;
 
-        if (Main.keyboard.shouldTakeEvent(event))
+        if (Main.keyboard.maybeHandleEvent(event))
             return Clutter.EVENT_PROPAGATE;
 
         if (button || touchBegin) {
index 6512bf0d237a8e6c80535c7b59d785d990e90957..af195dccfd883457733faab0737de3b1ab57775e 100644 (file)
@@ -1263,13 +1263,19 @@ var KeyboardManager = class KeyBoardManager {
             this._keyboard.resetSuggestions();
     }
 
-    shouldTakeEvent(event) {
+    maybeHandleEvent(event) {
         if (!this._keyboard)
             return false;
 
         const actor = global.stage.get_event_actor(event);
-        return Main.layoutManager.keyboardBox.contains(actor) ||
-               !!actor._extendedKeys || !!actor.extendedKey;
+
+        if (Main.layoutManager.keyboardBox.contains(actor) ||
+            !!actor._extendedKeys || !!actor.extendedKey) {
+            actor.event(event);
+            return true;
+        }
+
+        return false;
     }
 };